<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
	  <!--xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"-->
	  <!--layout:decorator="layout">-->
	  <head>
		  <meta charset="UTF-8"/>
		  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		  <title>118，我给母校发红包</title>
		  <link rel="stylesheet" href="/static/css/frozen.css" th:src="@{/static/css/frozen.css}"/>
		  <link rel="stylesheet" href="/static/css/pkuniversity.css" th:src="@{/static/css/pkuniversity.css}"/>
		  <script src="/static/js/jquery-1.12.1.min.js" th:src="@{/static/js/jquery-1.12.1.min.js}"/>
		  <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	  </head>
<body>
<!--<section layout:fragment="content">-->
<section>
		<div class="main" style="text-align: center;">
			<img src="static/img/hbj.png" th:src="@{/static/img/hbj.png}" style="width: 35%; margin-top: 1.5rem;" />
			<h3 class="bth9b tit">燕园红包君</h3>
		</div>
		<div class="bgf size30 thanks">
			<div class="width90 margin0auto">
					<h4 class="bth9b">感谢合力挺母校！</h4>
				<p>您是第 <span class="bth9b" th:text="${totalCountMap.giftCount}">3942</span> 位给母校送贺礼的校友和北大之友</p>
				<p th:if="${user.type} eq 0">在<span th:text="${user.grade} + ${user.department}">1949级物理系</span>中，您是第<span class="bth9b" th:text="${gradeCountMap.departmentCount}">23</span>位给母校发红包的校友</p>
				<p>母校更美好— —我们的荣光，我们的期盼！</p>
			</div>
		</div>
			<div class="rbtn give-redcard">嘚瑟一下</div>

<!-- 分享 -->
<div id="share-float"  style="display:none;">
	<div class="container">
		<div class="share-doc">
			<img src="/static/img/fx.png" th:src="@{/static/img/fx.png}" />
		</div>
	</div>
</div>
<!--  分享 end -->
<script>
	$(function(){
		$(".give-redcard").on("click",function(){
			$("#share-float").show();
		});

		$("#share-float").bind("click", function (e) {
			var $dom = $(e.srcElement || e.target) ;
			if(!$dom.closest(".container").length){
				$("#share-float").hide()
			}
		});
	})
</script>
	<script th:inline="javascript">


		if (typeof WeixinJSBridge == "undefined") {
			if (document.addEventListener) {
				document.addEventListener('WeixinJSBridgeReady', wxfx, false);
			} else if (document.attachEvent) {
				document.attachEvent('WeixinJSBridgeReady', wxfx);
				document.attachEvent('onWeixinJSBridgeReady', wxfx);
			}
		} else {
			wxfx();
		}


		var shareapp_data = {};
		var sharetimeline_data = {};
		var callId= /*[[${callId}]]*/'';
		var result = (callId =="" || callId=="null")?0:1;
		var nick = /*[[${user.realName}]]*/'';
		var count = /*[[${totalCountMap.giftCount}]]*/'';
		var call = /*[[${callOrder.name}]]*/'';

		function wxfx(){
			wx.config({
				debug: false,
				appId: /*[[${wx_config_wxAppId}]]*/'',
				timestamp: /*[[${wx_config_timeStamp}]]*/'',
				nonceStr: /*[[${wx_config_nonceStr}]]*/'',
				signature: /*[[${wx_config_signature}]]*/'',
				jsApiList: [
					'checkJsApi',
					'onMenuShareTimeline',
					'onMenuShareAppMessage',
					'onMenuShareQQ',
					'onMenuShareWeibo'
				]
			});

			var title="";
			if(nick==null|| nick =="null" ||nick == ""){
				title = "我";
			}else{
				title = '我是【' + nick+ '】,';
			}
			if (result == 1) {//
				shareapp_data = {
					title: title + '参与了【'+ call +'】召集令，成为了第'+count +'位给北大发红包的校友/朋友。',
					desc: '北京大学118周年校庆活动',
					link: 'http://'+ /*[[${globalHostName}+'/peking/gift-call/'+${callId}+'/gift']]*/''+'/peking/gift-call/'+callId+'/gift',
					imgUrl:'http://'+ /*[[${globalHostName}+'/static/img/pku.jpg']]*/''
				};
				sharetimeline_data = {
					title: title + '参与了【'+ call +'】召集令，成为了第'+count +'位给北大发红包的校友/朋友。',
					desc: '北京大学118周年校庆活动',
					link: 'http://'+ /*[[${globalHostName}+'/peking/gift-call/'+${callId}+'/gift']]*/'',
					imgUrl: 'http://'+ /*[[${globalHostName}+'/static/img/pku.jpg']]*/''
				}
				wx.onMenuShareAppMessage(shareapp_data);
				wx.onMenuShareTimeline(sharetimeline_data);
			} else if (result == 0) {//
				shareapp_data = {
					title: ( title=='我'?"":title)+'我给北大发出了第'+count+'个红包。',
					desc: '北京大学118周年校庆活动',
					link: 'http://'+ /*[[${globalHostName}+'/peking/index']]*/'',
					imgUrl: 'http://'+ /*[[${globalHostName}+'/static/img/pku.jpg']]*/''
				};
				sharetimeline_data = {
					title: ( title=='我'?"":title)+'我给北大发出了第'+count+'个红包。',
					desc: '北京大学118周年校庆活动',
					link: 'http://'+ /*[[${globalHostName}+'/peking/index']]*/'',
					imgUrl:'http://'+ /*[[${globalHostName}+'/static/img/pku.jpg']]*/''
				}
				wx.onMenuShareAppMessage(shareapp_data);
				wx.onMenuShareTimeline(sharetimeline_data);
			}
		}
	</script>
	</section>
	</body>
</html>
